<?php

namespace app\middleware;

class Auth
{

    public function handle($request, \Closure $next)
    {
        //接收
        $token = input('token');
        //解密token
        $data = checkToken($token);
        if ($data['code'] != 1) {
            return json(['status' => 500, 'msg' => '请先登录']);
        }
        return $next($request);
    }
}
